package com.fc.mall.service;

import com.fc.mall.dto.SmsBargainPromotion;
import com.fc.mall.dto.SmsBargainPromotionProduct;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 砍价活动管理Service
 * Created by charles on 2019/9/7
 */
public interface SmsBargainPromotionService {
    /**
     * 添加砍价活动
     */
    @Transactional
    int create(SmsBargainPromotion bargainPromotion);

    /**
     * 根据砍价活动id删除砍价活动
     */
    @Transactional
    int delete(Long id);

    /**
     * 根据砍价活动id更新砍价活动信息
     */
    @Transactional
    int update(Long id, SmsBargainPromotion bargainPromotion);

    /**
     * 分页获取砍价活动列表
     */
    List<SmsBargainPromotion> list(String keyword, Integer filterType, Integer pageSize, Integer pageNum);

    /**
     * 获取砍价活动详情
     * @param id 砍价活动表id
     */
    SmsBargainPromotion getBargainPromotion(Long id);

    /**
     * 获取所有砍价活动列表
     */
    List<SmsBargainPromotion> getAllActive();

    @Transactional
    int addProduct(SmsBargainPromotionProduct bargainPromotionProduct);

    @Transactional
    int removeProduct(Long id);

    @Transactional
    int removeProduct(Long pId, Long bId);

    List<SmsBargainPromotionProduct> getProductList(Long promotionId);
}
